/*
 * Copyright (c) 2024-2025 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

#ifndef KS_STDDEF_H
#define KS_STDDEF_H

typedef char bool;
typedef unsigned long size_t;

#ifndef bool
#define true  (1)
#define false (0)
#endif

#ifndef NULL
#define NULL (0)
#endif

#ifndef CONFIG_KPRINTF_MUTE
#define CONFIG_KPRINTF_MUTE_IPCBUFFER (0)
#define CONFIG_KPRINTF_MUTE_SYSCALL   (0)
#define CONFIG_KPRINTF_MUTE_PAGETABLE (0)
#define CONFIG_KPRINTF_MUTE_ADDRSPACE (0)
#else
#ifndef CONFIG_KPRINTF_MUTE_KIPCBUFFER
#define CONFIG_KPRINTF_MUTE_KIPCBUFFER 0
#endif
#ifndef CONFIG_KPRINTF_MUTE_KSYSCALL
#define CONFIG_KPRINTF_MUTE_KSYSCALL 0
#endif
#ifndef CONFIG_KPRINTF_MUTE_KPAGETABLE
#define CONFIG_KPRINTF_MUTE_KPAGETABLE 0
#endif
#ifndef CONFIG_KPRINTF_MUTE_KADDRSPACE
#define CONFIG_KPRINTF_MUTE_KADDRSPACE 0
#endif
#define CONFIG_KPRINTF_MUTE_IPCBUFFER CONFIG_KPRINTF_MUTE_KIPCBUFFER
#define CONFIG_KPRINTF_MUTE_SYSCALL   CONFIG_KPRINTF_MUTE_KSYSCALL
#define CONFIG_KPRINTF_MUTE_PAGETABLE CONFIG_KPRINTF_MUTE_KPAGETABLE
#define CONFIG_KPRINTF_MUTE_ADDRSPACE CONFIG_KPRINTF_MUTE_KADDRSPACE
#endif

#define DPRINTF_MUTE_THREAD (1)
#define DPRINTF_MUTE_FAULT  (1)

#define DEBUG_PRINT_MSG(msg) kprintf("[debug] " msg " at %s %d %s\n", __FILE__, __LINE__, __func__)
#define DEBUG_PRINT_ARG(msg, ...) \
    kprintf("[debug] " #__VA_ARGS__ " = " msg " at %s %d %s\n", __VA_ARGS__, __FILE__, __LINE__, __func__)

#endif
